import store from "@/store";
import router from "@/router";
router.beforeEach((to, from, next) => {
    const token = store.state.login.user.nickname;
    if (token) {
        if (to.path === "/login") {
            next('/');
        }
    } else {
        if (to.path === "/cart" || to.path === "/my") {
            next('/login')
        }
    }
    next();
})